package com.jandar.spider.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface PunishStatisticsMapper {

    @Select("select max(punish_time) from punish_data where area=#{area}")
    LocalDateTime getMaxPunishTimeByArea(String area);

    @Select("select count(id) from punish_data where area=#{area}")
    Integer getCountByArea(String area);

    @Select("select count(id) from punish_data")
    Integer getCount();

    @Select("select count(1) from punish where punish_number in (select punish_number from punish_data group by punish_number having count(1) > 1)")
    Integer getRepeatCount();
}
